from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from config.env import UploadConfig
from pathlib import Path

def mount_staticfiles(app: FastAPI):
    """
    挂载静态文件
    """
    app.mount('/preview', StaticFiles(directory='public/generic'), name='preview')
    app.mount(f'{UploadConfig.UPLOAD_PREFIX}', StaticFiles(directory=f'{UploadConfig.UPLOAD_PATH}'), name='profile')
